<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
</head>
<body>
    
</body>
<script>
    
/* initial table */
var aoa = [
  ['营销资源声量走势8888888888888',null,null,null],
  ['99999999999999999','1'],
	["This",   "is",     "a",    "Test"],
	["வணக்கம்", "สวัสดี", "你好", "가지마"],
	[1,        2,        3,      4],
	["Click",  "to",     "edit", "cells"],
  [],
  [],
  [],
  ['营销资源声量走势27777777777777',null,null,null],
  ['表头','表头']
];
// var ws = XLSX.utils.aoa_to_sheet(aoa);
// var html_string = XLSX.utils.sheet_to_html(ws, { id: "data-table", editable: true });
// document.getElementById("container").innerHTML = html_string;

const ws = XLSX.utils.aoa_to_sheet(aoa)
// 如果一张excel有多个数据，每一个数据最上面有一个标题，
// 如果没合并的话，虽然看起来也没毛病，但是文案长度还是在一个格子里面的，只是超出了，看起来好像合并了
ws['!merges'] = [
  {
    s:{
      r:0,
      c:0,
    },
    e: {
      r:0,
      c:3,
    }
  },
  {
    s:{
      r:8,
      c:0,
    },
    e: {
      r:8,
      c:3,
    }
  }
]
const wb = XLSX.utils.book_new()
XLSX.utils.book_append_sheet(wb, ws, 'sheet')
XLSX.writeFile(wb, '测试名字' + '.xlsx')

</script>
</html>